function LocationMode(calendar, location) {
    this._calendar = calendar;
    this._location = location;
    this.cursor = 'calendar-paint-cursor'; 
}

LocationMode.prototype = {
    onSelection: function(sender, e) {
        if(!this._location){return;}
        var me = this;
        var dateRange = e.data.dateRange;
        this._calendar.beginTransaction();

        var dayModels = dateRange.toDayArray().select(function(date) {
            return me._calendar.getDay(date);
        });

        var action = new LocationAction(dayModels, this._location);
        this._calendar.applyAction(action);
        if (dayModels.length == 1) {
            googleAnalyser.trackPageView('/FillSingleLocation')
        }
        else {
            googleAnalyser.trackPageView('/DragFillLocation')
        }        
    }
};

